﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZX.Common;
using ZX.DBModule;


namespace ZX.SYS.Bussiness
{
    public class WorkFlowStartInfo : ZX.BLL.Extend.BaseBussnies
    {
        public bool Start(string Entity, object KeyValue, string workflowid, string worktaskid, string workTaskInsId, string workFlowInsId)
        {
            if (this.entity == null)
            {
                this.entity = new DataTableBaseEntity();
            }

            DataTableBaseEntity _entity = this.entity as DataTableBaseEntity;
            _entity.TableName = Entity;
            string[] strArrary = _entity.GetKey();
            if (strArrary != null)
            {
                _entity.TableKey = strArrary[0];
                _entity.KeyType = strArrary[1];
            }

            _entity.CreateDT(KeyValue.ToString());
            //_entity.DRow[_entity.TableKey] = KeyValue;
            _entity.DRow["WorkFlowId"] = workflowid;
            _entity.DRow["WorkTaskId"] = worktaskid;
            _entity.DRow["WorkTaskInsId"] = workTaskInsId;
            _entity.DRow["WorkFlowInsId"] = workFlowInsId;
            return this.Update();
        }
    }
}
